Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrKiemke_kho
    Private data As DataTable
    Private Tungay, Denngay As String
    Private Mahanghoa, Tenhanghoa As String
    Private thang, nam, kho As String
    Private customerReport As ReportDocument

    Private Sub FrmCrKiemke_kho_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'MessageBox.Show(thang)
        Dim sqlQuery As String = "SELECT * FROM tbl_dot_kiemke_kho where recycleID='" & nam & thang & "' AND (ton_sosach<>0 OR ton_thucte<>0 OR thua<>0 OR thieu<>0 ) ORDER BY ma_hanghoa "
        Dim reportPath = Application.StartupPath & "\" & "crKiemke_kho.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("month", thang)
        customerReport.SetParameterValue("year", nam)
        customerReport.SetParameterValue("TKho", kho)
        customerReport.SetParameterValue("company", globalVariale.COMPANY)
        customerReport.SetParameterValue("address", globalVariale.ADDRESS)
        Me.CrThekho_NXTTongHopview.ReportSource = customerReport
    End Sub

    Private Sub BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Close()
    End Sub
    Public Sub setThang(ByVal s As String)
        thang = s
    End Sub

    Public Sub setNam(ByVal s As String)
        nam = s
    End Sub
    Public Sub setKho(ByVal s As String)
        kho = s
    End Sub
    


End Class
